From 61c46d911ff0840752bf8aa595d42da012d5d7b7 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 20 Nov 2013 17:30:22 +0000 Subject: [PATCH] gtkentry: Return early from gtk_entry_clear() if no icon info exists This helps scan-build avoid some false positive potential NULL pointer dereference warnings. https://bugzilla.gnome.org/show_bug.cgi?id=712760 --- gtk/gtkentry.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index d3f2ab58b9..c0b9d4343f 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -7437,7 +7437,10 @@ gtk_entry_clear (GtkEntry *entry, EntryIconInfo *icon_info = priv->icons[icon_pos]; GtkImageType storage_type; - if (icon_info && _gtk_icon_helper_get_is_empty (icon_info->icon_helper)) + if (icon_info == NULL) + return; + + if (_gtk_icon_helper_get_is_empty (icon_info->icon_helper)) return; g_object_freeze_notify (G_OBJECT (entry)); -- 2.30.2